package com.SmsModule.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;

import util.TotalClass;

import com.SmsModule.bean.TbSmsSc;
import com.dianbo.bean.DianboType;
import com.order.bean.TbOrder;

public class TbSmsScDAO {

	/**
	 *@author qingyu zhang
	 *@function:
	 *2011-4-13
	 *上午08:27:19
	 *zzClub
	 *com.SmsModule.dao
	 */
	private String sql = "";
	private TbSmsSc smsSc=null;
	private ResultSet rs = null;
	private List<TbSmsSc> smsScList = null;
	private Statement st = null;
	/**
	 * 
	 *@author qingyu zhang
	 *@function:根据上传的短信ID得到单个上传对象
	 * @param smsId
	 * @return
	 *2011-4-13
	 *上午08:29:20
	 *zzClub
	 *com.SmsModule.dao
	 *TbSmsSc
	 */
	public TbSmsSc getTbSmsSc(int smsId){
		sql = "select * from tb_smsRec_sc where smsId="+smsId;
		rs = new TotalClass().getResult(sql);
		try {
			while(rs.next()){
				if(smsSc==null){
					smsSc = new TbSmsSc();
				}
				smsSc = this.getTbSmsSc(rs);
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return smsSc;
	}
	public TbSmsSc getTbSmsSc(ResultSet rs){
		TbSmsSc tbSmsSc = new TbSmsSc();
		try {
			tbSmsSc.setCreateTime(rs.getString("createTime"));
			tbSmsSc.setDestAdd(rs.getString("destAdd"));
			tbSmsSc.setSendPhone(rs.getString("sendPhone"));
			tbSmsSc.setSmscontent(rs.getString("smscontent"));
			tbSmsSc.setSmsId(rs.getInt("smsId"));
			tbSmsSc.setSmsType(rs.getInt("smsType"));
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return tbSmsSc;
	}
}
